Note the task ID from the response -- you need it for the next step.
Step 3: Wait for the timer
Use the
TaskOutput
tool to block until the timer completes:
Set
block: true
Set
timeout: 600000
(maximum: 10 minutes / 600000ms)
Use the task ID from Step 2
If the wait exceeds 10 minutes
TaskOutput will return before the timer completes because the maximum timeout is 600000ms. Check the output -- if it does not contain "Timer complete", call TaskOutput again with the same task ID and
block: true
. Repeat until the timer finishes.
Step 4: Execute the deferred task
Once TaskOutput returns output containing "Timer complete. Proceed with deferred task.", carry out whatever work the user requested.
Important Notes
The agent session must remain open for the timer to work. If the user closes the session, the deferred task will not execute. Warn the user about this.
For very long waits (multiple hours), remind the user that the session needs to stay active.
If the user asks to cancel, use
TaskStop
with the background task ID.
Always tell the user the calculated wake time so they know when to expect the action.